export default {
  namespaced:true,
  state: {
    username: sessionStorage.getItem('username'),
    token: sessionStorage.getItem('token')
  },
  mutations: {
    setUserInfo(state, userInfo) {
      console.log(userInfo);
      state.username = userInfo.username;
      state.token = userInfo.token
      sessionStorage.setItem('username', state.username);
      sessionStorage.setItem('token', state.token);
    }
  },
  getters:{
    getToken(state){
      return state.token
    }
  }
}